#include <boost/program_options.hpp>

#include <iostream>
#include <string>
namespace
{
	const size_t ERROR_IN_COMMAND_LINE = 1;
	const size_t SUCCESS = 0;
	const size_t ERROR_UNHANDLED_EXCEPTION = 2;
}
int main(int argc, char *argv[])
{
	namespace po = boost::program_options;
	po::options_description desc("Options");
	const std::string test_case("test-case");
	desc.add_options()
		("help", "Print help messages")
		(test_case.c_str(), po::value<int>(), "unit test case")
		("like", "this");
	try {
		po::variables_map vm;
		po::store(po::parse_command_line(argc, argv, desc), vm);
		if (vm.count("help"))
		{
			std::cout << "Basic command line parameter app" << desc << std::endl;
			return SUCCESS;
		}
		if (vm.count(test_case)) {
			int tc = vm[test_case].as<int>();
			std::cout << "test case=" << tc << std::endl;
		}
	} catch(po::error& e) {
		std::cerr << "Error: " << e.what() << std::endl << std::endl;
		std::cerr << desc << std::endl;
		return ERROR_IN_COMMAND_LINE;
	}
	return SUCCESS;
}
